let nums:number[] = [18,6,9,23,88,5]

function fun(nums:number[]){
    let arr:any[]=[]
    nums.forEach((item:number)=>{
        if(item<10){
            arr.push('0'+String(item))
        }else{
            arr.push(item)
        }
    })
    return  arr
}
console.log(fun(nums));
